#include <sds/sfile.h>
#include <sds/sdataset.h>
#include <sds/sdataview.h>

#include <cstdio>

using namespace std;
using namespace sds;

int main(int argc, const char *argv[]) {
  int n = argc - 2;
  SFile tf(argv[1], SFile::CREATE);
  for (int i = 0; i < n; ++i) {
    SFile sf(argv[i + 2]);
    for (int j = 0; j < 3; ++j) {
      char name[256];
      SDataset sd = sf.getDataset(j);
      vector<SInteger> size = sd.getSize();
      sprintf(name, "%s_%d", argv[i + 2], j + 1);
      SDataset td = tf.createDataset(name, UINT8, size);
      td.setDataView<unsigned char>(sd.getDataView<unsigned char>());
    }
  }
  return 0;
}
